//
//  WPCURLFactory.m
//  Wallpaper.co
//
//  Created by zhou_yuepeng on 2017/9/4.
//  Copyright © 2017年 www.dahuatech.com. All rights reserved.
//

#import "WPCURLFactory.h"

static NSString* const URL_PREFIX_THEMES = @"http://papers.co/iphone/wp-content/themes/simon-wp-framework";

@implementation WPCURLFactory
+ (NSString*)getThemesUrlWithTag:(NSString*)tag page:(NSInteger)page
{
    if ([tag isEqualToString:@"new"]) {
        return [NSString stringWithFormat:@"%@/api-new.php?page=%ld", URL_PREFIX_THEMES, (long)page];
    }
    else {
        return [NSString stringWithFormat:@"%@/api-tag.php?tag=%@&page=%ld", URL_PREFIX_THEMES, tag, (long)page];
    }
}

+ (NSURL*)getThumbnailURLWithTitle:(NSString*)title
{
    NSString *urlString = [NSString stringWithFormat:@"http://papers.co/iphone/wp-content/uploads/papers.co-%@-33-iphone6-wallpaper-250x444.jpg", title];
    
    return [NSURL URLWithString:urlString];
}

+ (NSURL*)getOriginalPicURLWithTitle:(NSString*)title
{
    NSString *urlString = [NSString stringWithFormat:@"http://papers.co/wallpaper/papers.co-%@-33-iphone6-wallpaper.jpg", title];
    
    return [NSURL URLWithString:urlString];
}

+ (NSString*)getGeneralURLWithSource:(NSString*)source
{
    NSString *urlString = [NSString stringWithFormat:@"http://papers.co/iphone/wp-content/themes/simon-wp-framework/api-%@.php?", source];
    
    return urlString;
}
@end
